package com.xiaolanshu.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ErrorResult {

    private String errorCode;
    private String errMessage;

    public static ErrorResult error(){
        return ErrorResult.builder().errorCode("999999").errMessage("系统异常稍后再试").build();
    }
    public static ErrorResult userNoExist(){
        return ErrorResult.builder().errorCode("000001").errMessage("用户不存在").build();
    }
    public static ErrorResult passwordError(){
        return ErrorResult.builder().errorCode("000002").errMessage("密码错误").build();
    }
    public static ErrorResult codeError(){
        return ErrorResult.builder().errorCode("000003").errMessage("验证码错误").build();
    }
   public static ErrorResult goodsError(){
        return ErrorResult.builder().errorCode("000004").errorCode("购物车不存在该商品").build();
   }
    public static ErrorResult crudError(){
        return ErrorResult.builder().errorCode("000005").errorCode("系统异常,数据更新失败").build();
    }
    public static ErrorResult payError(){
        return ErrorResult.builder().errorCode("000006").errorCode("支付失败，用户余额不足").build();
    }

}
